using System.Collections.Generic;
using UnityEngine;

public class CarBoostButton : MonoBehaviour
{
	public List<UISprite> boostAmountSprites;

	[SerializeField]
	private UILabel countBoost;

	private void Update()
	{
		if (PlayerBehavior.MyPlayer != null && PlayerBehavior.MyPlayer.currentCar != null)
		{
			int num = BCWStorage.Get<int>(MarketController.keyCountBoost);
			if (BCWStorage.Get<float>(EntityBehavior.keyPaidBoost) == 100f)
			{
				num++;
			}
			if (num > 0)
			{
				countBoost.text = num.ToString();
				countBoost.gameObject.SetActive(true);
			}
			else
			{
				countBoost.gameObject.SetActive(false);
			}
			boostAmountSprites.ForEach(delegate(UISprite sprite)
			{
				sprite.fillAmount = PlayerBehavior.MyPlayer.currentCar.currentBoostAmount / 100f;
			});
		}
	}
}
